Skip to content

[3.0] Respect saved profile color mode over stale session - #9900

Open
mattago93 wants to merge 1 commit into
SimpleMachines:release-3.0from
mattago93:fix-9860-profile-theme-color-mode
Open

mattago93 wants to merge 1 commit into
SimpleMachines:release-3.0from
mattago93:fix-9860-profile-theme-color-mode

Conversation

@mattago93

Copy link
Copy Markdown

This change addresses a possible cause of issue #9860, where selecting a color mode in the user's Look and Layout profile settings does not appear to change the theme.

The theme currently prioritizes a session-level color mode over the member's saved preference. Consequently, a stale session value can override a newly saved profile setting.

The updated logic prioritizes:

  1. An explicit color mode requested for the current page.
  2. The authenticated member's saved color mode.
  3. A session-level color mode, including guest preferences.
  4. The theme's configured default.

Verification:

  • Seven isolated PHP checks of the selection logic passed.
  • Confirmed the commit changes only Sources/Theme.php.
  • Full PHPUnit, Composer lint and browser-based integration tests have not been run.

Issues References (Fixes|Related|Closes)

Related #9860

Prefer the member's saved theme color mode over an older session value,
while preserving explicit mode changes and guest session preferences.

Refs SimpleMachines#9860

Signed-off-by: Mattia <agostini.19@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant